﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;

namespace xiaolanshu
{
    public partial class LipBox : UserControl
    {
        public LipBox()
        {
            InitializeComponent();
        }

        public DataRow box_data;

        public void reload()
        {
            MemoryStream ms = new MemoryStream((byte[])box_data["photo"]);
            Image i = Image.FromStream(ms, true);
            pictureBox.BackgroundImageLayout = ImageLayout.Stretch;
            pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
            pictureBox.Image = i;
            label1.Text = box_data["lname"].ToString();
            uiLabel.Text = box_data["price"].ToString() + "￥";
            cli.Text = "热度：" + box_data["clicknum"].ToString();
        }

        private void pictureBox_Click(object sender, EventArgs e)
        {
            box_data["clicknum"] = (int)box_data["clicknum"] + 1;
            reload();
            产品信息.productnum = box_data["lnum"].ToString();
            lipdetail f = new lipdetail();
            f.ShowDialog();
        }
    }
}
